/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package designpattern.FactoryPattern;

/**
 *
 * @author Mcdonald
 */
public class Factory {
    public IDatabase returnDB(String dbName){
        if(dbName.equals("mysql")){
            return new MySqlDB();
        }else if (dbName.equals("oracle")) {
            return new OracleDB();
        }else{
            throw new IllegalArgumentException();
        }
    }
}
